<?
	require_once("inc_security.php"); 
 	
	//khoi tao object Datagird
  
	$list = new fsDataGird($id_field, $name_field, translate_text("Listing"));
	$list->add('lin_value','Url','string',1,1);
   $list->add('',translate_text("Chi tiết"),"linkdetails");
   $list->add("lin_status","Active","int", 0, 0);
   $list->add('',translate_text("Edit"),"edit");
	$list->add('',translate_text("Delete"),"delete");
	$list->ajaxedit($fs_table);

	$total			= new db_count('SELECT 	count(*) AS count 
											 FROM 	'.$fs_table.' 
											 WHERE 	1 ' . $list->sqlSearch());

	$db_listing 	= new db_query('SELECT * 
									       FROM '.$fs_table.'
									       WHERE 1 ' . $list->sqlSearch() . '
									       ORDER BY '.$id_field.' ASC,' . $list->sqlSort() . $id_field .' DESC
									       ' . $list->limit($total->total));
	$total_row		= mysql_num_rows($db_listing->result);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?=$load_header?>
<?=$list->headerScript()?>
<script language="javascript" src="../../resource/js/swfObject.js"></script>
</head>
<body topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<? /*---------Body------------*/ ?>
<div id="listing">
<?=$list->showHeader($total_row)?>
    <?
    $i = 0;
    while($row = mysql_fetch_assoc($db_listing->result)){
        $i++;
        ?>
        <?=$list->start_tr($i, $row[$id_field])?>
        <td><?=$row["lin_value"];?></td>
        <td width="70" align="center">
            <? echo'<a title="Thông tin chi tiết" class="thickbox noborder a_detail" href="showlinks.php?url='. base64_encode(getURL()) . '&lin_value=' . $row["lin_value"] .'&TB_iframe=true&amp;height=900&amp;width=1000" /><b>Chi tiết</b></a>';?>
        </td>
        <?=$list->showCheckbox("lin_status", $row["lin_status"], $row[$id_field])?>
        <?=$list->showEdit($row[$id_field]); ?>
        <?=$list->showDelete($row[$id_field]); ?>
  		  <?=$list->end_tr();?>
        <?
    }
    ?>
    <?=$list->showFooter($total_row); ?>
</div>
<? /*---------Body------------*/ ?>
</body>
</html>
